package com.hand.liut.service;

import java.util.concurrent.TimeUnit;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Author: lxx
 * @Description: TODO
 * @DateTime: 2022/7/20 15:57
 **/
@Service
public class PaymentHystrixService {

  public String run_ok(Integer id) {
    return "正常运行" + Thread.currentThread().getName() + id;
  }

  public String run_timeout(Integer id) {
    try {
      TimeUnit.SECONDS.sleep(3);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    return "延迟运行" + Thread.currentThread().getName() + id;
  }

}
